package com.wish.housing.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wish.housing.entity.RoomReservation;
import com.wish.housing.entity.RoomReservationVO;
import com.wish.housing.entity.SysRegion;
import com.wish.housing.entity.TbRoomInfo;
import com.wish.housing.mapper.RoomReservationMapper;
import com.wish.housing.service.IRoomReservationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 预约房源表 服务实现类
 * </p>
 *
 * @author 
 * @since 2022-03-26
 */
@Service
public class RoomReservationServiceImpl extends ServiceImpl<RoomReservationMapper, RoomReservation> implements IRoomReservationService {

	@Override
	public IPage<RoomReservationVO> listAll(RoomReservationVO vo) {
		Page<RoomReservationVO> page = new Page<>(vo.getPageNum(), vo.getPageSize());
		IPage<RoomReservationVO> roomReservationVOIPage = getBaseMapper().listAll(page, vo);
		return roomReservationVOIPage;
	}

	@Override
	public List<SysRegion> regions() {
		return getBaseMapper().regions();
	}

	@Override
	public int updateStatus(RoomReservationVO roomReservationVO) {
		return getBaseMapper().updateStatus(roomReservationVO);
	}


}
